#ifndef __HW_APP_CONFIG_H__
#define __HW_APP_CONFIG_H__

#include "hi_type.h"

// #define __SEND_TO_TLV__

// #define __DEBUG_SAVE_YUV__
// #define __DEBUG_SAVE_TRACK__
// #define __DEBUG_SAVE_INOUT__

#define VIDEO_SERVICE_NAME  "/mnt/srvfs/video.iaas.sdc"
#define CODEC_SERVICE_NAME  "/mnt/srvfs/codec.iaas.sdc"
#define ALG_SERVICE_NAME    "/mnt/srvfs/algorithm.iaas.sdc"
#define UTILS_SERVICE_NAME  "/mnt/srvfs/utils.iaas.sdc"
#define ALARM_SERVICE_NAME  "/mnt/srvfs/alarm.paas.sdc"
#define EVENT_SERVICE_NAME  "/mnt/srvfs/event.paas.sdc"
#define PTZ_SERVICE_NAME    "/mnt/srvfs/ptz.iaas.sdc"
#define DEV_CACHE_NAME      "/dev/cache"
#define LABEL_EVENT_DATA    "tag.saas.sdc"
#define CACHE_META_DATA     "itgt.saas.sdc"

#define MODEL_INPUT_SIZE_WIDTH    640  // 模型输入大小宽
#define MODEL_INPUT_SIZE_HEIGHT   640  // 模型输入大小高
#define LPR_MODEL_INPUT_SIZE_WIDTH 168     // 车牌模型输入大小宽
#define LPR_MODEL_INPUT_SIZE_HEIGHT 48     // 车牌模型输入大小高
// #define LPR_MODEL_OUTPUT_SIZE_WIDTH 78     // 车牌模型输出大小宽
#define LPR_MODEL_OUTPUT_SIZE_WIDTH 81     // 车牌模型输出大小宽
#define LPR_MODEL_OUTPUT_SIZE_HEIGHT 21     // 车牌模型输出大小高
#define SAMPLE_SVP_NNIE_QUANT_BASE 4096    /*the base value*/

#define NMS_THRESH                (0.5f * SAMPLE_SVP_NNIE_QUANT_BASE)
#define CONF_THRESH               (0.5f * SAMPLE_SVP_NNIE_QUANT_BASE)

#define IMG_1080P_WIDTH           MODEL_INPUT_SIZE_WIDTH
#define IMG_1080P_HEIGHT          MODEL_INPUT_SIZE_HEIGHT

#define META_WIDTH_SIZE_SCALE     10000  // 元数据尺寸数值以0-10000的比例值发送
#define META_HEIGHT_SIZE_SCALE    10000

#define DEFAULT_CHN_ID            101|  // 默认主机通道号

#define SAMPLE_SVP_NNIE_COORDI_NUM  4      /*coordinate numbers*/

#define SAMPLE_SVP_NNIE_ALIGN_16  16
#define SAMPLE_SVP_NNIE_ALIGN_32  32

#define DL_IMAGE_YUV_CHANNEL      3
#define DL_IMAGE_UV_HALF          2

#define DEMO_FILE_NAME_LEN        256
#define PROTECT_VAL               (1e-6)

#define GC_NNIE_OBJ_SCORE_NUM 1             // 前景概率位数

static HI_FLOAT s_af32ExpCoef[10][16] = {
    {1.0f, 1.00024f, 1.00049f, 1.00073f, 1.00098f, 1.00122f, 1.00147f, 1.00171f, 1.00196f, 1.0022f, 1.00244f, 1.00269f, 1.00293f, 1.00318f, 1.00342f, 1.00367f},
    {1.0f, 1.00391f, 1.00784f, 1.01179f, 1.01575f, 1.01972f, 1.02371f, 1.02772f, 1.03174f, 1.03578f, 1.03984f, 1.04391f, 1.04799f, 1.05209f, 1.05621f, 1.06034f},
    {1.0f, 1.06449f, 1.13315f, 1.20623f, 1.28403f, 1.36684f, 1.45499f, 1.54883f, 1.64872f, 1.75505f, 1.86825f, 1.98874f, 2.117f, 2.25353f, 2.39888f, 2.55359f},
    {1.0f, 2.71828f, 7.38906f, 20.0855f, 54.5981f, 148.413f, 403.429f, 1096.63f, 2980.96f, 8103.08f, 22026.5f, 59874.1f, 162755.0f, 442413.0f, 1.2026e+006f, 3.26902e+006f},
    {1.0f, 8.88611e+006f, 7.8963e+013f, 7.01674e+020f, 6.23515e+027f, 5.54062e+034f, 5.54062e+034f, 5.54062e+034f, 5.54062e+034f, 5.54062e+034f, 5.54062e+034f, 5.54062e+034f, 5.54062e+034f, 5.54062e+034f, 5.54062e+034f, 5.54062e+034f},
    {1.0f, 0.999756f, 0.999512f, 0.999268f, 0.999024f, 0.99878f, 0.998536f, 0.998292f, 0.998049f, 0.997805f, 0.997562f, 0.997318f, 0.997075f, 0.996831f, 0.996588f, 0.996345f},
    {1.0f, 0.996101f, 0.992218f, 0.98835f, 0.984496f, 0.980658f, 0.976835f, 0.973027f, 0.969233f, 0.965455f, 0.961691f, 0.957941f, 0.954207f, 0.950487f, 0.946781f, 0.94309f},
    {1.0f, 0.939413f, 0.882497f, 0.829029f, 0.778801f, 0.731616f, 0.687289f, 0.645649f, 0.606531f, 0.569783f, 0.535261f, 0.502832f, 0.472367f, 0.443747f, 0.416862f, 0.391606f},
    {1.0f, 0.367879f, 0.135335f, 0.0497871f, 0.0183156f, 0.00673795f, 0.00247875f, 0.000911882f, 0.000335463f, 0.00012341f, 4.53999e-005f, 1.67017e-005f, 6.14421e-006f, 2.26033e-006f, 8.31529e-007f, 3.05902e-007f},
    {1.0f, 1.12535e-007f, 1.26642e-014f, 1.42516e-021f, 1.60381e-028f, 1.80485e-035f, 2.03048e-042f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}
};

#define LOG_PATH "/tmp/AIPlus.log"
#define DB_PATH "AIPlus.db3"
#define STATE_IMAGE_NAME "state.jpg"

#endif /* __HW_APP_CONFIG_H__ */
